//
//  LYMyLotteryViewController.m
//  lottery
//
//  Created by 赵国腾 on 16/6/10.
//  Copyright © 2016年 赵国腾. All rights reserved.
//

#import "LYMyLotteryViewController.h"
#import "UIImage+Expansion.h"
#import "LYSettingViewController.h"

@interface LYMyLotteryViewController ()

@property (nonatomic, weak) IBOutlet UIButton *loginButton;

@end

@implementation LYMyLotteryViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
//    UIImage *image = self.loginButton.currentBackgroundImage;
//    
//    image = [image stretchableImageWithLeftCapWidth:image.size.width * 0.5 topCapHeight:image.size.height * 0.5];
//    
//    [self.loginButton setBackgroundImage:image forState:UIControlStateNormal];
    
    // 设置导航条
    [self setupNav];
}

- (void)setupNav {
    
    // 左边
    UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
    [btn setTitle:@"客服" forState:UIControlStateNormal];
    [btn setImage:[UIImage imageNamed:@"FBMM_Barbutton"] forState:UIControlStateNormal];
    [btn sizeToFit];
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:btn];
    
    // 右边
    UIImage *image = [UIImage imageWithOriRenderingImage:@"Mylottery_config"];
    // 不需要渲染图片
    image = [image imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    
    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithImage:image style:UIBarButtonItemStylePlain target:self action:@selector(setting)];
}

- (void)setting {
    
    LYSettingViewController *settingCtrl = [[LYSettingViewController alloc] init];
    
    [self.navigationController pushViewController:settingCtrl animated:YES];
    NSLog(@"%s", __func__);
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
